<?php
// +----------------------------------------------------------------------
// | 有小象汇 自研正版源码 赋能开发者
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 http://www.uxphp.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 有小象汇并不是自由软件，未经许可不能去掉有小象汇相关版权
// +----------------------------------------------------------------------
// | Author:  有小象汇
// +----------------------------------------------------------------------

namespace app\api\controller\v1\car;


use app\Request;
use app\services\car\CarDateServices;

class CarDateController
{
    /**
     * 展示价格日历
     * @param Request $request
     * @param CarDateServices $services
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getPriceCalendar(Request $request,CarDateServices $services){
        $data = $request->getMore([
            ['type_id',''],
            ['price',''],
            ['zhoumo_price',''],
        ]);
        $data['sat_price'] = $data['zhoumo_price'];
        $data['sun_price'] = $data['zhoumo_price'];
        if(!$data['type_id']) return app('json')->fail('参数错误');
        return app('json')->success($services->getPriceCalendar($data));
    }
}
